﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="$safeitemrootname$.aspx.cs" Inherits="$rootnamespace$.$safeitemrootname$" %>

$controls-library-definition$

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    $head-settings$
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- 
        Sitemap Menu item:
        <siteMapNode url="~/$safeitemrootname$.aspx" title="$safeitemrootname$" description="$safeitemrootname$" image="fa-warning" id="$safeitemrootname$"/>
    -->
    <section class="panel">
	        <header class="panel-heading">
				<h2>$panel-header$</h2>
			</header>
            $toolbar-area$


            $layout-code$

			
            $footer-area$
	</section>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LocaJavascript" runat="server">
  $grid-definition$

  <script>
      /*
         FormlyManager parameters:
         container:         id of the formly containing div
         callbackSuccess:   callback function called on success
         callbackError:     callback function called in error
         shortcutCallback:  callback function called instead of the canonical send function ( if use this, not indicate the send function )
         onloadCallback:    callback function called on load
         beforeSumbit:      callback function called before the submit
      */
      var settings = new FormlySettings();
      settings.container = '#divContainer';
      settings.setLoad(settings.createGetConfig('/api/CONTROLLER_NAME/LOAD_FIELDS_METHOD_NAME'));
      settings.setSend(settings.createPostConfig('/api/CONTROLLER_NAME/LOAD_SEND_METHOD_NAME'));

      FormlyManager(settings);

      /* general closing dialog */
      function CloseDialog(response) {
          $('#crudDialog').dialog('close');

          ShowResponseMessage(response);
      }

      $action-code$

      $grid-action-code$
  </script>

</asp:Content>